import userCenter from './modules/userCenter'
import logCenter from './modules/logCenter'
import apps from './modules/apps'
import { permissionCodes as codes } from './permission'

import { asyncLoadComponent } from '@/routes/asyncLoadComponent'
import {
    HomeOutlined,
    AppstoreOutlined,
    // ReconciliationOutlined,
    AppstoreAddOutlined
} from '@ant-design/icons';
let routes = [
    {
        affix: true, // 如果设置为true，它则会固定在tags-view中(默认 false)
        path: '/',
        exact: true,
        auth: true,
        index: 0,
        pIndex: null,
        meta: {
            title: '首页',
            roles: [codes.user_center],
            icon: <HomeOutlined />
        },
        component: asyncLoadComponent(() => import('@/pages/home')),
    },
    userCenter,
    logCenter,
    ...apps,
    {
        path: '/appManage',
        exact: true,
        auth: true,
        index: 3,
        pIndex: null,
        component: asyncLoadComponent(() => import('@/pages/appManage/index')),
        meta: {
            title: '应用管理',
            roles: [codes.application.list],
            icon: <AppstoreAddOutlined />
        },
    },
    {
        path: '/login',
        exact: true,
        auth: false,
        index: 4,
        pIndex: null,
        meta: {
            hideLayout: true,
            title: '登录',
            hideInMenu: true,
            icon: <AppstoreOutlined />
        },
        component: asyncLoadComponent(() => import('@/pages/login')),
    },
    {
        path: '/browser',
        exact: true,
        auth: false,
        index: 4,
        pIndex: null,
        meta: {
            hideLayout: true,
            title: '下载浏览器',
            hideInMenu: true,
            icon: <AppstoreOutlined />
        },
        component: asyncLoadComponent(() => import('@/pages/browser/index')),
    },
    {
        path: '/404',
        exact: true,
        auth: false,
        index: 5,
        pIndex: null,
        meta: {
            hideLayout: true,
            title: 'error',
            hideInMenu: true,
            icon: <AppstoreOutlined />
        },
        component: asyncLoadComponent(() => import('@/pages/404')),
    },
]
export default routes